package com.nageoffer.shortlink.project.mq.producer;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
   import org.springframework.context.annotation.Bean;
   import org.springframework.context.annotation.Configuration;

   @Configuration
   public class SnowflakeConfig {

       @Bean
       public Snowflake snowflake() {
           // Hutool的Snowflake实现
           return IdUtil.createSnowflake(1, 1); // 参数分别为数据中心ID和机器ID
       }
   }